<?php
Loader::loadClass('ObjectUtilEx', "modules/VoteDataCenter/pnincludes");
Loader::loadClass('DateUtilEx', "modules/VoteDataCenter/pnincludes");
Loader::loadClass('PNObjectEx', "modules/VoteDataCenter/pnincludes");
Loader::loadClass('PNObjectExArray', "modules/VoteDataCenter/pnincludes");
Loader::loadClass('DBUtilEx', "modules/VoteDataCenter/pnincludes");
Loader::loadClass('InnoUtil', "modules/VoteDataCenter/pnincludes");

function VoteDataCenter_pntables()
{
    // Initialise table array
    $pntable = array();

    ////////////////////////////////////////////
    //Province table
    ////////////////////////////////////////////
    $pntable['votedatacenter_province'] = DBUtil::getLimitedTablename('votedatacenter_province');
    $pntable['votedatacenter_province_column'] = array(
                                        'id'                => 'pro_id',
                                        'name'              => 'pro_name',
                                        'latitude'          => 'pro_latitude',
                                        'longitude'         => 'pro_longitude'
    );
    $pntable['votedatacenter_province_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'varchar(255)',
                                        'latitude'          => 'varchar(255)',
                                        'longitude'         => 'varchar(255)'
    );
    $pntable['votedatacenter_province_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_province_column'], 'pro_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_province_column_def']);

    ////////////////////////////////////////////
    //District table
    ////////////////////////////////////////////
    $pntable['votedatacenter_district'] = DBUtil::getLimitedTablename('votedatacenter_district');
    $pntable['votedatacenter_district_column'] = array(
                                        'id'                => 'dis_id',
                                        'pro_id'            => 'dis_pro_id',
                                        'name'              => 'dis_name',
                                        'latitude'          => 'dis_latitude',
                                        'longitude'         => 'dis_longitude'
    );
    $pntable['votedatacenter_district_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',
                                        'name'              => 'varchar(255)',
                                        'latitude'          => 'varchar(255)',
                                        'longitude'         => 'varchar(255)'
    );
    $pntable['votedatacenter_district_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_district_column'], 'dis_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_district_column_def']);

    $pntable['votedatacenter_district_column_idx'] = array('idx_dis_pro_id' => 'pro_id');

    ////////////////////////////////////////////
    //Tambon table
    ////////////////////////////////////////////
    $pntable['votedatacenter_tambon'] = DBUtil::getLimitedTablename('votedatacenter_tambon');
    $pntable['votedatacenter_tambon_column'] = array(
                                        'id'                => 'tam_id',
                                        'pro_id'            => 'tam_pro_id',
                                        'dis_id'            => 'tam_dis_id',
                                        'name'              => 'tam_name',
                                        'latitude'          => 'tam_latitude',
                                        'longitude'         => 'tam_longitude'
    );
    $pntable['votedatacenter_tambon_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',   
                                        'dis_id'            => 'INT(11) NOTNULL',  
                                        'name'              => 'varchar(255)',
                                        'latitude'          => 'varchar(255)',
                                        'longitude'         => 'varchar(255)'
    );
    $pntable['votedatacenter_tambon_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_tambon_column'], 'tam_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_tambon_column_def']);

    $pntable['votedatacenter_tambon_column_idx'] = array(
                                                          'idx_tam_pro_id' => 'pro_id',
                                                          'idx_tam_dis_id' => 'dis_id'
    );

    ////////////////////////////////////////////
    //Village table
    ////////////////////////////////////////////
    $pntable['votedatacenter_village'] = DBUtil::getLimitedTablename('votedatacenter_village');
    $pntable['votedatacenter_village_column'] = array(
                                        'id'                => 'vil_id',
                                        'pro_id'            => 'vil_pro_id',
                                        'dis_id'            => 'vil_dis_id',
                                        'tam_id'            => 'vil_tam_id',
                                        'moo'               => 'vil_moo',
                                        'name'              => 'vil_name',
                                        'latitude'          => 'vil_latitude',
                                        'longitude'         => 'vil_longitude'
    );
    $pntable['votedatacenter_village_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',   
                                        'dis_id'            => 'INT(11) NOTNULL',  
                                        'tam_id'            => 'INT(11) NOTNULL',
                                        'moo'               => 'INT(11) NOTNULL',
                                        'name'              => 'varchar(255)',
                                        'latitude'          => 'varchar(255)',
                                        'longitude'         => 'varchar(255)'
    );
    $pntable['votedatacenter_village_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_village_column'], 'vil_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_village_column_def']);

    $pntable['votedatacenter_village_column_idx'] = array(
                                                          'idx_vil_pro_id' => 'pro_id',
                                                          'idx_vil_dis_id' => 'dis_id',
                                                          'idx_vil_tam_id' => 'tam_id',
                                                          'idx_vil_moo'   => 'moo'
    );

    ////////////////////////////////////////////
    //House no. table
    ////////////////////////////////////////////
    $pntable['votedatacenter_house_no'] = DBUtil::getLimitedTablename('votedatacenter_house_no');
    $pntable['votedatacenter_house_no_column'] = array(
                                        'id'                => 'hou_id',
                                        'pro_id'            => 'hou_pro_id',
                                        'dis_id'            => 'hou_dis_id',
                                        'tam_id'            => 'hou_tam_id',
                                        'vil_id'            => 'hou_vil_id',
                                        'vil_moo'           => 'hou_vil_moo',
                                        'no'                => 'hou_no',
                                        'unit'              => 'hou_unit',
                                        'trok'              => 'hou_trok',
                                        'soi'               => 'hou_soi',
                                        'road'              => 'hou_road',
                                        'zipcode'           => 'hou_zipcode',
                                        'latitude'          => 'hou_latitude',
                                        'longitude'         => 'hou_longitude',
                                        'amount_person'     => 'hou_amount_person'

    );
    $pntable['votedatacenter_house_no_column_def'] = array(
                                        'id'                => 'BIGINT(255) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',   
                                        'dis_id'            => 'INT(11) NOTNULL',  
                                        'tam_id'            => 'INT(11) NOTNULL',
                                        'vil_id'            => 'INT(11) NOTNULL',
                                        'vil_moo'           => 'INT(11) NOTNULL',
                                        'no'                => 'varchar(50)',
                                        'unit'              => 'INT(11) NOTNULL',
                                        'trok'              => 'INT(11) ',
                                        'soi'               => 'VARCHAR(255)',
                                        'road'              => 'VARCHAR(255)',
                                        'zipcode'           => 'INT(11) ',
                                        'latitude'          => 'varchar(255)',
                                        'longitude'         => 'varchar(255)',
                                        'amount_person'     => 'INT(11) NOTNULL DEFAULT 0'
    );
    $pntable['votedatacenter_house_no_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_house_no_column'], 'hou_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_house_no_column_def']);

    $pntable['votedatacenter_house_no_column_idx'] = array(
                                                           'idx_hou_pro_id' => 'pro_id',
                                                           'idx_hou_dis_id' => 'dis_id',
                                                           'idx_hou_tam_id' => 'tam_id',
                                                           'idx_hou_id'     => 'vil_id',
                                                           'idx_hou_moo'    => 'vil_moo',
    );

    ////////////////////////////////////////////
    //Person table
    ////////////////////////////////////////////
    $pntable['votedatacenter_person'] = DBUtil::getLimitedTablename('votedatacenter_person');
    $pntable['votedatacenter_person_column'] = array(
                                        'id'                => 'per_id',
                                        'pro_id'            => 'per_pro_id',
                                        'dis_id'            => 'per_dis_id',
                                        'tam_id'            => 'per_tam_id',
                                        'vil_id'            => 'per_vil_id',
                                        'vil_moo'           => 'per_vil_moo',
                                        'hou_id'            => 'per_hou_id',
                                        'gen_id'            => 'per_gen_id',
                                        'pid'               => 'per_pid',
                                        'firstname'         => 'per_firstname',
                                        'lastname'          => 'per_lastname',
                                        'telephone'         => 'per_telephone',
                                        'mobilephone'       => 'per_mobilephone',
                                        'birthdate'         => 'per_birthdate'
    );
    $pntable['votedatacenter_person_column_def'] = array(
                                        'id'                => 'BIGINT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',
                                        'dis_id'            => 'INT(11) NOTNULL',
                                        'tam_id'            => 'INT(11) NOTNULL',
                                        'vil_id'            => 'INT(11) NOTNULL',
                                        'vil_moo'           => 'INT(11) NOTNULL',
                                        'hou_id'            => 'INT(11) NOTNULL',
                                        'gen_id'            => 'INT(11) NOTNULL',
                                        'pid'               => 'VARCHAR(255)',
                                        'firstname'         => 'VARCHAR(255)',
                                        'lastname'          => 'VARCHAR(255)',
                                        'telephone'         => 'VARCHAR(255)',
                                        'mobilephone'       => 'VARCHAR(255)',
                                        'birthdate'         => 'DATE'
    );
    $pntable['votedatacenter_person_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_person_column'], 'per_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_person_column_def']);

    $pntable['votedatacenter_person_column_idx'] = array(
                                                          'idx_per_pro_id'     => 'pro_id',
                                                          'idx_per_dis_id'     => 'dis_id',
                                                          'idx_per_tam_id'     => 'tam_id',
                                                          'idx_per_vil_id'     => 'vil_id',
                                                          'idx_per_vil_moo'    => 'vil_moo',
                                                          'idx_per_hou_id'     => 'hou_id',
                                                          'idx_per_gen_id'     => 'gen_id',
                                                          'idx_per_pid'        => 'pid'
    );


    ////////////////////////////////////////////
    //Gender table
    ////////////////////////////////////////////
    $pntable['votedatacenter_gender'] = DBUtil::getLimitedTablename('votedatacenter_gender');
    $pntable['votedatacenter_gender_column'] = array(
                                        'id'                => 'gen_id',
                                        'name'              => 'gen_name'
    );
    $pntable['votedatacenter_gender_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'varchar(255)'
    );
    $pntable['votedatacenter_gender_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_gender_column'], 'gen_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_gender_column_def']);


    ////////////////////////////////////////////
    //Party table
    ////////////////////////////////////////////
    $pntable['votedatacenter_party'] = DBUtil::getLimitedTablename('votedatacenter_party');
    $pntable['votedatacenter_party_column'] = array(
                                        'id'                => 'par_id',
                                        'name'              => 'par_name'
    );
    $pntable['votedatacenter_party_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'varchar(255)'
    );
    $pntable['votedatacenter_party_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_party_column'], 'par_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_party_column_def']);


    ////////////////////////////////////////////
    //Candidate table
    ////////////////////////////////////////////
    $pntable['votedatacenter_candidate'] = DBUtil::getLimitedTablename('votedatacenter_candidate');
    $pntable['votedatacenter_candidate_column'] = array(
                                        'id'                => 'can_id',
                                        'par_id'            => 'can_par_id',
                                        'name'              => 'can_name'
    );
    $pntable['votedatacenter_candidate_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'par_id'            => 'INT(11) NOTNULL',
                                        'name'              => 'varchar(255)'
    );
    $pntable['votedatacenter_candidate_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_candidate_column'], 'can_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_candidate_column_def']);

    $pntable['votedatacenter_candidate_column_idx'] = array('idx_can_par_id' => 'par_id');

    ////////////////////////////////////////////
    //Person relationship with party table
    ////////////////////////////////////////////
    $pntable['votedatacenter_person_party'] = DBUtil::getLimitedTablename('votedatacenter_person_party');
    $pntable['votedatacenter_person_party_column'] = array(
                                        'id'                => 'ppa_id',
                                        'par_id'            => 'ppa_par_id',
                                        'per_id'            => 'ppa_per_id'
    );
    $pntable['votedatacenter_person_party_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'par_id'            => 'INT(11) NOTNULL',
                                        'per_id'            => 'INT(11) NOTNULL'
    );
    $pntable['votedatacenter_person_party_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_person_party_column'], 'ppa_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_person_party_column_def']);

    $pntable['votedatacenter_person_party_column_idx'] = array(
                                                                'idx_ppa_par_id' => 'par_id',
                                                                'idx_ppa_per_id' => 'per_id'
    );


    ////////////////////////////////////////////
    //Person relationship with Leader Canvasser table
    ////////////////////////////////////////////
    $pntable['votedatacenter_person_leader_canvasser'] = DBUtil::getLimitedTablename('votedatacenter_person_leader_canvasser');
    $pntable['votedatacenter_person_leader_canvasser_column'] = array(
                                        'id'                => 'plc_id',
                                        'par_id'            => 'plc_par_id',
                                        'per_id'            => 'plc_per_id'
    );
    $pntable['votedatacenter_person_leader_canvasser_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'par_id'            => 'INT(11) NOTNULL',
                                        'per_id'            => 'INT(11) NOTNULL'
    );
    $pntable['votedatacenter_person_leader_canvasser_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_person_leader_canvasser_column'], 'plc_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_person_leader_canvasser_column_def']);

    $pntable['votedatacenter_person_leader_canvasser_column_idx'] = array(
                                                                          'idx_plc_par_id' => 'par_id',
                                                                          'idx_plc_per_id' => 'per_id'
    );



    ////////////////////////////////////////////
    //Person relationship with canvasser table
    ////////////////////////////////////////////
    $pntable['votedatacenter_person_canvasser'] = DBUtil::getLimitedTablename('votedatacenter_person_canvasser');
    $pntable['votedatacenter_person_canvasser_column'] = array(
                                        'id'                  => 'pcv_id',
                                        'plc_id'              => 'pcv_plc_id',
                                        'par_id'              => 'pcv_par_id',
                                        'per_id'              => 'pcv_per_id'
    );
    $pntable['votedatacenter_person_canvasser_column_def'] = array(
                                        'id'                  => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'plc_id'              => 'INT(11) NOTNULL',
                                        'par_id'              => 'INT(11) NOTNULL',
                                        'per_id'              => 'INT(11) NOTNULL'
    );
    $pntable['votedatacenter_person_canvasser_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_person_canvasser_column'], 'pcv_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_person_canvasser_column_def']);

    $pntable['votedatacenter_person_canvasser_column_idx'] = array(
                                                                    'idx_pcv_par_id' => 'par_id',
                                                                    'idx_pcv_per_id' => 'per_id',
                                                                    'idx_pcv_plc_id' => 'plc_id'
    );

    ////////////////////////////////////////////
    //Project table
    ////////////////////////////////////////////
    $pntable['votedatacenter_project'] = DBUtil::getLimitedTablename('votedatacenter_project');
    $pntable['votedatacenter_project_column'] = array(
                                        'id'                => 'poj_id',
                                        'pro_id'            => 'poj_pro_id',
                                        'dis_id'            => 'poj_dis_id',
                                        'tam_id'            => 'poj_tam_id',
                                        'filename'          => 'poj_filename'
    );
    $pntable['votedatacenter_project_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',   
                                        'dis_id'            => 'INT(11) NOTNULL',  
                                        'tam_id'            => 'INT(11) NOTNULL',
                                        'filename'          => 'varchar(255)'
    );
    $pntable['votedatacenter_project_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_project_column'], 'poj_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_project_column_def']);

    $pntable['votedatacenter_project_column_idx'] = array(
                                                          'idx_poj_pro_id' => 'pro_id',
                                                          'idx_poj_dis_id' => 'dis_id',
                                                          'idx_poj_tam_id' => 'tam_id'
    );


    ////////////////////////////////////////////////////
    //Excel table : Use for store the file information
    ///////////////////////////////////////////////////
    $pntable['votedatacenter_excel'] = DBUtil::getLimitedTablename('votedatacenter_excel');
    $pntable['votedatacenter_excel_column'] = array(
                                        'id'            => 'exc_id',
                                        'user_id'       => 'exc_user_id',
                                        'name'          => 'exc_name',
                                        'file_path'     => 'exc_file_path',
                                        'lastupdate'    => 'exc_lastupdate',
                                        'status'        => 'exc_status',
                                        'step_no'       => 'exc_step_no',
                                        'error'         => 'exc_error',
    );
    $pntable['votedatacenter_excel_column_def'] = array(
                                        'id'            => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'user_id'       => 'INT(11) NOTNULL',
                                        'name'          => 'VARCHAR(255) NOT NULL',
                                        'file_path'     => 'VARCHAR(255)',
                                        'lastupdate'    => 'DATE',
                                        'status'        => 'INT(3)',
                                        'step_no'       => 'INT(3)',
                                        'error'         => 'TEXT',
    );
    $pntable['votedatacenter_excel_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_excel_column'], 'exc_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_excel_column_def']);


    ////////////////////////////////////////////
    //Person table
    ////////////////////////////////////////////
    $pntable['votedatacenter_extend_remark'] = DBUtil::getLimitedTablename('votedatacenter_extend_remark');
    $pntable['votedatacenter_extend_remark_column'] = array(
                                        'id'                => 'erm_id',
                                        'pro_id'            => 'erm_pro_id',
                                        'dis_id'            => 'erm_dis_id',
                                        'tam_id'            => 'erm_tam_id',
                                        'vil_moo'           => 'erm_vil_moo',
                                        'value'             => 'erm_value'
    );
    $pntable['votedatacenter_extend_remark_column_def'] = array(
                                        'id'                => 'BIGINT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',
                                        'dis_id'            => 'INT(11) NOTNULL',
                                        'tam_id'            => 'INT(11) NOTNULL',
                                        'vil_moo'           => 'INT(11) NOTNULL',
                                        'value'             => 'INT(11) NOTNULL'
    );
    $pntable['votedatacenter_extend_remark_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_extend_remark_column'], 'per_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_extend_remark_column_def']);

    $pntable['votedatacenter_extend_remark_column_idx'] = array(
                                                          'idx_per_pro_id'     => 'pro_id',
                                                          'idx_per_dis_id'     => 'dis_id',
                                                          'idx_per_tam_id'     => 'tam_id',
                                                          'idx_per_vil_moo'    => 'vil_moo'
    );
 

    ////////////////////////////////////////////
    //Canvasser extend person table  
    ////////////////////////////////////////////
    $pntable['votedatacenter_extperson'] = DBUtil::getLimitedTablename('votedatacenter_extperson');
    $pntable['votedatacenter_extperson_column'] = array(
                                        'id'                => 'exp_id',
                                        'pro_id'            => 'exp_pro_id',
                                        'dis_id'            => 'exp_dis_id',
                                        'tam_id'            => 'exp_tam_id',
                                        'vil_moo'           => 'exp_vil_moo',
                                        'house_no'          => 'exp_house_no',
                                        'pid'               => 'exp_pid',
                                        'gen_id'            => 'exp_gen_id',
                                        'firstname'         => 'exp_firstname',
                                        'lastname'          => 'exp_lastname',
                                        'telephone'         => 'exp_telephone'
    );

    $pntable['votedatacenter_extperson_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'pro_id'            => 'INT(11) NOTNULL',   
                                        'dis_id'            => 'INT(11) NOTNULL',  
                                        'tam_id'            => 'INT(11) NOTNULL',
                                        'vil_moo'           => 'INT(11) NOTNULL',
                                        'house_no'          => 'VARCHAR(255)',
                                        'pid'               => 'VARCHAR(255)',
                                        'gen_id'            => 'INT(11) NOTNULL',
                                        'firstname'         => 'VARCHAR(255)',
                                        'lastname'          => 'VARCHAR(255)',
                                        'telephone'         => 'VARCHAR(255)'
    );
    $pntable['votedatacenter_extperson_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['votedatacenter_extperson_column'], 'exp_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['votedatacenter_extperson_column_def']);

    $pntable['votedatacenter_extperson_column_idx'] = array(
                                                          'idx_exp_pro_id'     => 'pro_id',
                                                          'idx_exp_dis_id'     => 'dis_id',
                                                          'idx_exp_tam_id'     => 'tam_id',
                                                          'idx_exp_vil_moo'     => 'vil_moo',
                                                          'idx_exp_hou_id'     => 'hou_id',
                                                          'idx_exp_gen_id'     => 'gen_id',
                                                          'idx_exp_pid'        => 'pid'
    );


    return $pntable;
}